<%@page import="servlets.MainServlet"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<link href="../css/table.css" rel="stylesheet" type="text/css">
<link href="../css/button.css" rel="stylesheet" type="text/css">
<body topmargin="0" leftmargin="0">
<jsp:include page="header.jsp" flush="true" />
<div id="content">
	<div class="styled-table">
		<table style="width: 98%;">
			<thead>
				<tr>
					<td>Fecha Recepcion</td>
					<td>DNI Destinatario</td> 
					<td>Nombre Destinatario</td>
					<td>Apellido Destinatario</td>
					<td>Cliente</td>
					<td></td>
				</tr>
			</thead>
			<c:choose>
				<c:when test="${fn:length(envios) gt 0}">
					
					<c:forEach items="${envios}" var="envio" varStatus="status" >
					<tr>
				 		<td><fmt:formatDate value="${envio.fechaRecepcion}" pattern="dd/MM/yyyy"/></td>
						<td><c:out value="${envio.dniDestinatario}"/></td>
				 		<td><c:out value="${envio.nombreDestinatario}"/></td>
				 		<td><c:out value="${envio.apellidoDestinatario}"/></td>
				 		<td><c:out value="${envio.idCliente}"/></td>
						<td><a href="../servlet/mainServlet?actionId=3&envioId=<c:out value="${envio.envioId}"/>" class="myButton">Ver Envio</a></td>
					</tr>
				</c:forEach>
				</c:when>
				<c:otherwise>
					<tr>
						<td colspan="6">No se encontraron envíos</td>
					</tr>
				</c:otherwise>
			</c:choose>
			
		</table>
	</div>
</div><!-- content -->
<jsp:include page="footer.jsp" flush="true" />